package com.wang.back.filter;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;

import com.wang.common.servlet.BaseServlet;

/**
 * 过滤器的执行顺序和名字有关，(按照类名的ascii排序)
 * 如果是html,js,css发送请求也要过滤
 * @author Zjx
 *
 */
@WebFilter(urlPatterns = "/*")
public class Filter01CharacterEncoding extends BaseServlet implements Filter
{
	@Override
	public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
			throws IOException, ServletException
	{
		System.out.println("==CharacterEncodingFilter=doFilter==");
		request.setCharacterEncoding("UTF-8");
		chain.doFilter(request, response);
	}

}
